//
//  YTDefaultPageControlView.swift
//  YTImgeViewer
//
//  Created by aron on 2018/5/25.
//

import Foundation

class YTDefaultPageControlView: UIView {
    
    private lazy var pageContol: UIPageControl = {
        var pageContol = UIPageControl()
        return pageContol
    }()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        self.setupUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        
        self.pageContol.frame = self.bounds
    }
    
    func setupUI() {
        self.addSubview(self.pageContol)
    }
    
    func setPage(currentPage: Int, numberOfPages: Int) {
        self.pageContol.numberOfPages = numberOfPages
        self.pageContol.currentPage = currentPage
    }
}
